package zeroj.web.validator.impl;

import zeroj.web.validator.IValidator;

/**
 * 
 * @author LYL(lyl at gmail dot com)
 *
 * @since 1.0
 *
 * 2008-9-30
 */
public class StringValidator implements IValidator {
	
	private int minLen;
	private int maxLen;
	
	public StringValidator(int minLen, int maxLen) {
		
		this.minLen = minLen;
		this.maxLen = maxLen;
	}
	public boolean isValid(String value) {
		
		int len = value.length();
		return len >= minLen && len <= maxLen;
	}

}
